package com.mimi.config;

import java.util.List;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.mimi.entity.FtpSetting;
import com.mimi.interfaces.catalog.IConfigService;
import com.mimi.service.impl.AbstractModuleServiceImpl;
import com.mimi.util.ConfigProvider;

@Transactional
@Service("catalogServiceImpl")
public class ConfigServiceImpl extends AbstractModuleServiceImpl implements IConfigService {

    @Override
    public void init() {
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public List<FtpSetting> getListConfigs() {
        return getDaoHelper().getDao(FtpSetting.class).findAll();
    }

    public static void main(String[] args) {
    	System.out.println("Hello");
    	FtpSetting config = new FtpSetting();
    	config.setFptHostname("http://abc.com");
    	
    	ConfigProvider.getInstance().getDaoHelper().getDao(FtpSetting.class).save(config);
	}
}
